package com.goal98.team;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

/**
 * User: liu
 * Date: 2009-10-27
 * Time: 13:09:13
 */
public class DateUtil {
    public static Date nextSunday(){
        Calendar calendar = new GregorianCalendar();
        int delta = 7 - calendar.get(GregorianCalendar.DAY_OF_WEEK);
        if (GregorianCalendar.SUNDAY == calendar.getFirstDayOfWeek()){
            delta += 1;    
        }
        calendar.add(GregorianCalendar.DATE, delta);
        calendar.set(GregorianCalendar.HOUR_OF_DAY, 15);
        calendar.set(GregorianCalendar.MINUTE, 0);
        return calendar.getTime();

    }

}
